package arcturus;


import acm.graphics.GImage;
import mapProperties.*;

public class User extends Entity  {
	
	//private GImage user; this is a GI image just call super -- travis anderson
	private boolean dead = false;
	private int health = 50;
	private int xVelocity = 0;
	private int yVelocity = 0;
	private boolean onGround = true;
	private int level = 1;
	private int exp = 0;
	private int expToLevelUp = 20;
	Gun gun = new Gun();
	
	
	public User(int health, String picLocation) {
		super(USER_MAX_HEALTH, PASS_INDX_IMPASSABLE, picLocation);		
	}
/*
	public User(String picLocation) {
		super(picLocation);// this is the right way
		user = new GImage(picLocation);//doing double on memory this is a GI image the line above loads a gi image
		
		
	}
	*/
	/*
	@Override
	public boolean isDead() {
		return dead;
	}

	@Override
	public void takeDamage(int damage) {
		health -= damage;	
	}

	@Override
	public void move() {
		if(!isDead()){
			double x = user.getX();
			double y = user.getY();
			user.move(x + xVelocity, y + yVelocity);
			if(xVelocity < 0){
				xVelocity += 3;
			} else if(xVelocity > 0){
				xVelocity -= 3;
			}
			if(!onGround){
				yVelocity += 5;
			}
		}
	}
	*/
	public double getX(){
		return super.getX();
	}
	public double getY(){
		return super.getY();
	}
	
	public int getxVelocity() {
		return xVelocity;
	}

	public void setxVelocity(int xVelocity) {
		this.xVelocity = xVelocity;
	}
	
	public int getyVelocity(){
		return yVelocity;
	}
	
	public void setyVelocity(int yVelocity){
		this.yVelocity = yVelocity;
	}

	public void setHealth(int health){
		this.health = health;
	}
	public int getHealth(){
		return health;
	}

	public boolean isOnGround() {
		return onGround;
	}

	public void setOnGround(boolean onGround) {
		this.onGround = onGround;
	}

	public int getExpToLevelUp() {
		return expToLevelUp;
	}

	public void setExpToLevelUp(int expToLevelUp) {
		this.expToLevelUp += expToLevelUp;
	}

	public int getExp() {
		return exp;
	}

	public void setExp(int exp) {
		this.exp += exp;
		if(this.exp >= expToLevelUp){
			this.exp -= expToLevelUp;
			setLevel(1);
		}
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level += level;
		this.gun.damage += 10;
		setExpToLevelUp(25);
	}

}
